package com.bjsxt.base.mytest.abstractfactory;

public class AnimalFactory {

    public static Animal creatAnimal(AnimalEnum animalEnum){
        switch (animalEnum){
            case cat:
                return new Cat();
            case dog:
                return new Dog();
            case pig:
                return new Pig();
        }
        return null;
    }
}
